package com.gljx.web.dao;

import com.gljx.web.Entity.Item;
import com.gljx.web.Entity.Message;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

/**
 * 消息中心dao
 * @Author:  LiXiang 
 * @Date: Created in 2018/2/8 9:58
 */
@Component
public interface MessageMapper {
    /*Integer deleteByPrimaryKey(Integer id);

    Integer insert(Message record);*/

    /**
     * 插入待办事项
     * @Author:  LiXiang
     * @Date: Created in 2018/2/8 16:04
     * @param record
     * @return
     */
    Integer insertSelective(Item record);


    /**
     * 新增消息
     *
     * @param record
     * @return
     */
    Integer insertMessage(Message record);

    /**
     * 详情
     * @Author:  LiXiang 
     * @Date: Created in 2018/2/9 9:20
     * @param id
     * @return
     */
    Message selectByPrimaryKey(Integer id);

    /**
     * 更新消息
     * @Author:  LiXiang
     * @Date: Created in 2018/2/8 16:03
     * @param record
     * @return
     */
    Integer updateByPrimaryKeySelective(Message record);

    Integer updateItemByPrimaryKey(Item record);

    /**
     * 分页
     * @Author:  LiXiang
     * @Date: Created in 2018/2/8 16:03
     * @param data
     * @return
     */
    public Map<String,Object > selectMessagePage(Map<String, Object> data);

    /**
     * 待办分页
     * @Author:  LiXiang
     * @Date: Created in 2018-05-02 9:40
     * @param data
     * @return
     */
    public Map<String,Object > selectItemPage(Map<String, Object> data);

    /**
     * 批量插入
     * @Author:  LiXiang
     * @Date: Created in 2018/2/23 14:56
     * @param list
     * @return
     */
    public Integer insertMessageList(@Param("list") List<Message> list);

    public Integer insertItemList(@Param("list") List<Item> list);

    /**
     * 根据单据编号将消息改为已读
     * @return
     */
    public Integer isUseAudit(@Param("companyID") String companyID,
                              @Param("fnumber") String fnumber,
                              @Param("isuse") Integer isuse,
                              @Param("projectID") String projectID);
    //Integer updateByPrimaryKey(Message record);
}